package com.gulimall.common.constants;

import lombok.Getter;

/**
 * @author coder_ccy  码表
 * @date 2022/4/2 11:27
 *
 * 000000  success
 * 010001  用户权限不够
 *
 * new CodeMsg()  不可以
 * codeMsg.setMsg() 不可以
 *
 * codeMsg.getMsg()  可以
 *
 * 封装
 */

public class CodeMsg {   //  new CodeMsg("11010101","哦耶")   构造方法private   code.setCode()     高低原则   高内聚【单一职责】，低耦合


    @Getter
    private long code;

    @Getter
    private String msg;

    //1. 通用codemsg  00 00 0000
    public static final CodeMsg COMMON_SUCCESS = new CodeMsg(00000000L,"success");


    //2. 商品微服务   13 23 0000
    public static final CodeMsg PRODUCT_CATEGORY_NOCATEGORY = new CodeMsg(13230001L,"没有该类型");


    //3. 会员中心微服务     15 22 0000
    public static final CodeMsg MEMBER_MEMBER_USERNAMEERROR = new CodeMsg(15220001L,"没有该用户");
    public static final CodeMsg MEMBER_MEMBER_PASSWORDERROR = new CodeMsg(15220002L,"密码错误");


    private CodeMsg(long code,String msg){
        this.code = code;
        this.msg = msg;
    }

}
